import request from '@/utils/request'

// 获取优先级下拉列表
export function getWorkPriorityList() {
  return request({
    url: '/operation/web/operationLaboratoryWorkOrder/getWorkPriorityList',
    method: 'get'
  })
}

// 获取化验类型下拉列表
export function getWorkTypeList() {
  return request({
    url: '/operation/web/operationLaboratoryWorkOrder/getWorkTypeList',
    method: 'get'
  })
}

// 获取化验项目下拉列表
export function getItemList() {
  return request({
    url: '/operation/web/operationLaboratoryWorkOrder/itemList',
    method: 'get'
  })
}

// 获取采样点位下拉列表
export function getSamplingLocationList() {
  return request({
    url: '/operation/web/operationLaboratoryWorkOrder/samplingLocationList',
    method: 'get'
  })
}

// 查询化验工单列表
export function getLaboratoryWorkOrderList(params) {
  return request({
    url: '/operation/web/operationLaboratoryWorkOrder/list',
    method: 'get',
    params
  })
}

// 获取化验工单详情
export function getLaboratoryWorkOrderDetail(id) {
  return request({
    url: `/operation/web/operationLaboratoryWorkOrder/detail/${id}`,
    method: 'get'
  })
}

// 提交化验结果
export function submitLaboratoryResult(data) {
  return request({
    url: '/operation/web/operationLaboratoryWorkOrder/submit',
    method: 'post',
    data
  })
}

// 获取化验工单详细信息
export function getLaboratoryWorkOrderInfo(id) {
  return request({
    url: `/operation/web/operationLaboratoryWorkOrder/${id}`,
    method: 'get'
  })
}

// 新增化验工单
export function addLaboratoryWorkOrder(data) {
  return request({
    url: '/operation/web/operationLaboratoryWorkOrder',
    method: 'post',
    data
  })
}

// 修改化验工单
export function updateLaboratoryWorkOrder(data) {
  return request({
    url: '/operation/web/operationLaboratoryWorkOrder',
    method: 'put',
    data
  })
}

// 删除化验工单
export function deleteLaboratoryWorkOrder(id) {
  return request({
    url: `/operation/web/operationLaboratoryWorkOrder/${id}`,
    method: 'delete'
  })
}

// 批量删除化验工单
export function batchDeleteLaboratoryWorkOrder(ids) {
  return request({
    url: `/operation/web/operationLaboratoryWorkOrder/batch/${ids}`,
    method: 'delete'
  })
}

// 导出化验工单
export function exportLaboratoryWorkOrder(params) {
  return request({
    url: '/operation/web/operationLaboratoryWorkOrder/export',
    method: 'get',
    params,
    responseType: 'blob'
  })
}